10 ' Exercise to get IBM-PC configuration from vectors in ROM BIOS
20 ' Peter G. Wohlmut
30 ' 5-3-82
40 '
50 DEF SEG=&H40 ' set reference for ROM BIOS configuration check
60 DIM RS232(4),PRINTER(4)
70 FOR I=1 TO 8 STEP 2:J=INT(I-1)/2+1:RS232(J)=PEEK(I+1)*256+PEEK(I):PRINTER(J)=PEEK(9+I)*256+PEEK(8+I):NEXT I 'saves upto 4 rs232 and printer addresses
80 CONFIG1=PEEK(&H10):CONFIG2=PEEK(&H11)
90 DISKS=0:IF (CONFIG1 AND 1) =1 THEN DISKS = (CONFIG1 AND (2^6+2^7))/32
100 GAMES=(CONFIG2 AND 16)/16
110 NO.RS232 = (CONFIG2 AND 14)/2
120 VIDEO = (CONFIG1 AND (2^4 +2^5))/16
130 NO.PRINTER = (CONFIG2 AND (2^6 +2^7))/64
140 MEMSIZE = PEEK(&H14)*256+PEEK(&H13)
150 RAM = PEEK(&H16)*256+PEEK(&H15)
160 SCREEN.TYPE = VIDEO MOD 3:MIDDLE=(80-40*(SCREEN.TYPE MOD 2))/2:WIDTH 2*MIDDLE